/*
 * @Author: Zhangxx 2425792130@qq.com
 * @Date: 2024-07-01 11:03:10
 * @LastEditors: restart 2425792130@qq.com
 * @LastEditTime: 2024-07-24 14:18:51
 * @FilePath: \geek-pc\src\store\index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import React from "react"
import LoginStore from './login.Store'
import UserStore from './userStore'
import ChannelStore from './channelStore'
class RootStore {
  // 组合模块
  constructor() {
    this.loginStore = new LoginStore()
    this.UserStore = new UserStore()
    this.ChannelStore = new ChannelStore()
  }
}
// // 导入useStore方法供组件使用数据
// const StoresContext = React.createContext(new RootStore())
// export const useStore = () => React.useContext(StoresContext)



// 实例化根
// 导出useStore context
const rootStore = new RootStore()
const context = React.createContext(rootStore)
const useStore = () => React.useContext(context)
export { useStore }